package com.cm.caseManagement.service.impl;

import com.cm.caseManagement.dao.CmModifyTrackMapper;
import com.cm.caseManagement.pojo.entity.CmModifyTrack;
import com.cm.caseManagement.service.ICmModifyTrackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cm.caseManagement.utils.DateUtils;

import java.util.List;

/**
 * 变更轨迹Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmModifyTrackServiceImpl implements ICmModifyTrackService
{
    @Autowired
    private CmModifyTrackMapper cmModifyTrackMapper;

    /**
     * 查询变更轨迹
     *
     * @param id 变更轨迹主键
     * @return 变更轨迹
     */
    @Override
    public CmModifyTrack selectCmModifyTrackById(Long id)
    {
        return cmModifyTrackMapper.selectCmModifyTrackById(id);
    }

    /**
     * 查询变更轨迹列表
     *
     * @param cmModifyTrack 变更轨迹
     * @return 变更轨迹
     */
    @Override
    public List<CmModifyTrack> selectCmModifyTrackList(CmModifyTrack cmModifyTrack)
    {
        return cmModifyTrackMapper.selectCmModifyTrackList(cmModifyTrack);
    }

    /**
     * 新增变更轨迹
     *
     * @param cmModifyTrack 变更轨迹
     * @return 结果
     */
    @Override
    public int insertCmModifyTrack(CmModifyTrack cmModifyTrack)
    {
        cmModifyTrack.setCreateTime(DateUtils.getNowDate());
        return cmModifyTrackMapper.insertCmModifyTrack(cmModifyTrack);
    }

    /**
     * 修改变更轨迹
     *
     * @param cmModifyTrack 变更轨迹
     * @return 结果
     */
    @Override
    public int updateCmModifyTrack(CmModifyTrack cmModifyTrack)
    {
        cmModifyTrack.setUpdateTime(DateUtils.getNowDate());
        return cmModifyTrackMapper.updateCmModifyTrack(cmModifyTrack);
    }

    /**
     * 批量删除变更轨迹
     *
     * @param ids 需要删除的变更轨迹主键
     * @return 结果
     */
    @Override
    public int deleteCmModifyTrackByIds(Long[] ids)
    {
        return cmModifyTrackMapper.deleteCmModifyTrackByIds(ids);
    }

    /**
     * 删除变更轨迹信息
     *
     * @param id 变更轨迹主键
     * @return 结果
     */
    @Override
    public int deleteCmModifyTrackById(Long id)
    {
        return cmModifyTrackMapper.deleteCmModifyTrackById(id);
    }
}
